/**
 * \file  data_base.h
 * \brief Definition of DataBase class.
 *
 * LAV: Lib Anti Virals
 * <http://lav.googlecode.com/>
 * Copyright (C) 2010 Velez Ezequiel, Peralta Andres, FuDePAN
 *
 * This file is part of the LAV project.
 *
 * Contents:       Header file for LAV providing class DataBase.
 *
 * System:         LAV
 * Language:       C++
 *
 * Author:         Velez Ezequiel, Peralta Andres
 * E-Mail:
 *
 * LAV is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * LAV is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with LAV.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef DATA_BASE_H
#define DATA_BASE_H

#include <mili/mili.h>
#include "lav/antiviral_set.h"


namespace lav
{

/**
 * This class defines a DataBase
 *
 */
class DataBase
{

private:

    /**
     * This typedef represents the real set of antivirals
     *
     */
    typedef std::list<ResisBasedAntiviral> Antivirals;

    /**
     * This typedef represents antivirals names
     *
     */
    typedef std::list<std::string> Names;

    Antivirals antivirals;
    Antivirals validated_antivirals;


    /**
     * This method copies all antivirals list
     *
     */
    void copy_antivirals();

public:

    /**
     * This method loads the database from an XML file
     *
     *@Param file_name Path of the XML file
     *
     */
    void load_file(const char* file_name);


    /**
     * This method returns the set's iterator
     *
     */
    AVIterator get_iterator();


    /**
     * This method prints al database information
     *
     */
    void print_database();


    /**
     * This method references an antiviral set to an antiviral set pointers
     *
     *@Param antiviral_set Path of the XML file
     *
     */
    void get_antivirals(AntiviralSet& antiviral_set);


    /**
     * This method ignores the list names. Plugin's use
     *
     *@Param names Names to will be ignored
     *
     */
    void ignore_antivirals(const Names& names);


    /**
     * This method returns the registers count from the data base
     *
     */
    inline size_t size() const
    {
        return antivirals.size();
    }
};

}

#endif

